<template>
	<view class="fui-pictures">
		<view
			:style="'padding:' + diyitem.style.paddingtop * 2 + 'rpx ' + diyitem.style.paddingleft * 2 + 'rpx;background:' + diyitem.style.background + ';'"
			v-if="diyitem.params.showtype == 0"
		>
			<view @tap="navigate" class="item" :data-url="item.linkurl" style="padding:10rpx" v-for="(item, index) in diyitem.data" :key="index" wx:for-index="idx">
				<view class="image" :style="'text-align:' + diyitem.style.titlealign + ';color:' + diyitem.style.titlecolor">
					<image mode="widthFix" :src="item.imgurl"></image>
					<view class="title" :style="'color:' + item.titlecolor">{{ item.title }}</view>
				</view>
				<view class="text" :style="'text-align:' + diyitem.style.textalign + ';color:' + diyitem.style.textcolor">{{ item.text }}</view>
			</view>
		</view>
		<view
			:style="
				'overflow:hidden;white-space:nowrap;padding:' +
					diyitem.style.paddingtop * 2 +
					'rpx ' +
					diyitem.style.paddingleft * 2 +
					'rpx;background:' +
					diyitem.style.background +
					';'
			"
			v-else
		>
			<scroll-view scroll-x>
				<view @tap="navigate" class="item" :data-url="item.linkurl" style="padding:10rpx" v-for="(item, index) in diyitem.data" :key="index" wx:for-index="idx">
					<view class="image" :style="'text-align:' + diyitem.style.titlealign + ';color:' + diyitem.style.titlecolor">
						<image mode="widthFix" :src="item.imgurl"></image>
						<view class="title" :style="'color:' + item.titlecolor">{{ item.title }}</view>
					</view>
					<view class="text" :style="'text-align:' + diyitem.style.textalign + ';color:' + diyitem.style.textcolor">{{ item.text }}</view>
				</view>
			</scroll-view>
		</view>
	</view>
</template>
<script>
export default {
	props: {
		diyitem: {
			type: Object
		},
		item:{}
		
	},
	methods: {
		navigate(e) {
			uni.navigateTo({
				url: e.currentTarget.dataset.url,
				fail() {
					uni.switchTab({
						url: e.currentTarget.dataset.url
					});
				}
			});
		}
	}
};
</script>